home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / mawk10.zip / MEMORY.H < prev    next >
C/C++ Source or Header  |  1991-10-05  |  1KB  |  60 lines

  1.  
  2. /********************************************
  3. memory.h
  4. copyright 1991, Michael D. Brennan
  5.  
  6. This is a source file for mawk, an implementation of
  7. the AWK programming language.
  8.  
  9. Mawk is distributed without warranty under the terms of
  10. the GNU General Public License, version 2, 1991.
  11. ********************************************/
  12.  
  13.  
  14. /* $Log:    memory.h,v $
  15.  * Revision 3.3.1.1  91/09/14  17:23:51  brennan
  16.  * VERSION 1.0
  17.  * 
  18.  * Revision 3.3  91/08/13  06:51:51  brennan
  19.  * VERSION .9994
  20.  * 
  21.  * Revision 3.2  91/06/28  04:17:08  brennan
  22.  * VERSION 0.999
  23.  * 
  24.  * Revision 3.1  91/06/07  10:27:59  brennan
  25.  * VERSION 0.995
  26.  * 
  27.  * Revision 2.1  91/04/08  08:23:37  brennan
  28.  * VERSION 0.97
  29.  * 
  30. */
  31.  
  32.  
  33. /*  memory.h  */
  34.  
  35. #ifndef  MEMORY_H
  36. #define  MEMORY_H
  37.  
  38. #include "zmalloc.h"
  39.  
  40. #define  new_CELL()  (CELL *) zmalloc(sizeof(CELL))
  41. #define  free_CELL(p)  zfree(p,sizeof(CELL))
  42.  
  43. #ifndef  SUPPRESS_NEW_STRING_PROTO
  44. STRING  *PROTO( new_STRING, (char *, ...) ) ;
  45. #endif
  46.  
  47. #ifdef   DEBUG
  48. void  PROTO( DB_free_STRING , (STRING *) ) ;
  49.  
  50. #define  free_STRING(s)  DB_free_STRING(s)
  51.  
  52. #else
  53.  
  54. #define  free_STRING(sval)   if ( -- (sval)->ref_cnt == 0 )\
  55.                                 zfree(sval, (sval)->len+5) ; else
  56. #endif
  57.  
  58.  
  59. #endif   /* MEMORY_H */
  60.